<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ userName }}</div>
    <el-button type="primary" @click="addRouter">测试</el-button>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'userName'

    ])
  },
  methods: {
    addRouter() {
      this.$router.addRoutes([
        {
          path: '/aaa',
          name: 'aaa',
          component: () => import('./aaa.vue')
        }
      ])
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
